import { defineStore } from 'pinia';

export const useSysStore = defineStore('sys', {
	state: () => {
		return { 
			token: '',
			
		};
	},
	getters: {
		getToken: state => {
			return state.token ? state.token : uni.getStorageSync('token')
		},
		
	},
	actions: {
		setToken(token: any) {
			this.token = token
			uni.setStorage({
				key: 'token',
				data: token
			})
		},
	}
});